<?php
include '/include/db.php';
$id_hash = @$_GET['id'];

if(!$id_hash)
{
echo "错误，页面不存在";	

}
else
{   
	$activity =	GetActivityByHash($id_hash);
	//echo $activity["Id"];
	$comments = GetCommentsByActivity($activity["Id"]);
	//print_r($comments);
	$votedatas = GetVoteDatasByActivity($activity["Id"]);
	//print_r($votedatas);
	$votes = GetVotesByActivity($activity["Id"]);
	if(!$activity)
	{
	echo "错误，页面不存在";
	return;
	}
	//print_r($activity);
$title = $activity["Title"];
$createrName = $activity["Name"];
$startTime = $activity['Time'];
$countComments = count($comments);
$countParticipants = count($votedatas);
$countVotes = count($votes);
$pollDescription = $activity["Description"];
$tableView = "表格";
$calendarView = "日历";
include "/view/vote/result.php";
}